package com.np.retrofit211demo1.service;

import com.np.retrofit211demo1.bean.UltrasoundResponse;
import com.np.retrofit211demo1.bean.RecordBean;

import java.util.List;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import okhttp3.ResponseBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.Headers;
import retrofit2.http.POST;
import retrofit2.http.Query;
import retrofit2.http.Streaming;
import retrofit2.http.Url;

public interface UltrasoundService {

    @POST("api/cons/saveOrUpdate")
    @Headers({"Content-Type: application/json"})
    Observable<UltrasoundResponse> saveOrUpdate(@Body RequestBody body);

    @GET("api/cons/listByDeviceSn")
    Observable<UltrasoundResponse<List<RecordBean>>> getRecordList(@Query("deviceSn") String deviceSn);

    @GET("api/rtsp/getPushUrl")
    Observable<UltrasoundResponse<String>> getRtspUrl(@Query("machineId") String machineId);

    @Streaming
    @GET
    Observable<ResponseBody> download(@Url String url);

    @Streaming
    @GET("pdf/get")
    Observable<ResponseBody> downloadPDF(@Query("consId") String consId);
}